import request from '@/utils/request'
// 开始新的销售
export function makeNewSale() {
  return request({
    url: '/sale/makeNewSale',
    method: 'get'
  })
}
// 录入订单明细
export function enterItem(params) {
  return request({
    url: '/sale/enterItem',
    method: 'get',
    params: params
  })
}
// 结束录入
export function endSale() {
  return request({
    url: '/sale/endSale',
    method: 'get'
  })
}

// 确认支付
export function makePayment(params) {
  return request({
    url: '/sale/makePayment',
    method: 'get',
    params: params
  })
}

// 修改一行订单明细数量，自行完成
export function updateSaleItem(data) {
  return request({
    url: '/sale/changeQuantity',
    method: 'post',
    data: data
  })
}

// 删除一行订单明细，自行完成
export function delSaleItem(itemSn) {
  return request({
    url: '/sale/deleteSaleItem/' + itemSn,
    method: 'get'
  })
}

// 获得热销产品数据
export function getPieData() {
  return request({
    url: '/sale/pie',
    method: 'get'
  })
}
